#ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H

#include "Singleton.h"

#include <SDL.h>
#include <SDL_audio.h>
#include <SDL_mixer.h>
#include <string>
#include <assert.h>
#include <iostream>
#include <map>

class SoundManager : public Uncopyable 
{
private:
	SoundManager();
	friend class Singleton<SoundManager>;
public:
	bool LoadSound(const std::string& filename);
	bool LoadMusic(const std::string& filename);
	bool PlaySound(const std::string& filename, int loops);
	bool PlayMusic(const std::string& filename, int loops);

private:
	int audio_rate;
	Uint16 audio_format;
	int audio_channels;
	int audio_buffers;
	Mix_Music* music;
	Mix_Chunk* sound;

	std::map<std::string, Mix_Chunk*> m_musics;
	std::map<std::string, Mix_Chunk*> m_sounds;

};

typedef Singleton<SoundManager> TheSoundManager;


#endif //SOUNDMANAGER_H